package hn.cch.mybatis.plus.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.HashMap;
import java.util.Map;

@TableName("t_field")
public class FieldEntity {

    public static Map<String, String> map = new HashMap<>();

    static {
        map.put("a", "A");
        map.put("b", "B");
        map.put("c", "C");
        map.put("d", "D");
    }

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "str")
    private String str;

    @TableField(exist = false)
    private String value;

    @TableField(fill = FieldFill.INSERT_UPDATE)// 插入和更新时填充数据
    private String fill;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getFill() {
        return fill;
    }

    public void setFill(String fill) {
        this.fill = fill;
    }
}
